<template>
  <div class="content_page">
    <div class="content_page_title"  :class="['content_page_title', globalFont]">*您的问题或建议</div>
    <div class="content_page_box">
      <up-textarea v-model="content" border="none" placeholder="请描述您的问题或建议，以便我们提供更好的帮助…"></up-textarea>
    </div>
    <div  @click="submit" :class="['content_page_btn', globalFont]">提交反馈</div>
  </div>
</template>
<script lang="ts" setup>
import { ref,getCurrentInstance } from "vue";
const content = ref<string>("");
import { saveFeedback } from '@/api/myInfo/myInfo.ts'
import { onLoad } from "@dcloudio/uni-app";
const submit = () => {
  saveFeedback({
    content: content.value
  }).then((res: any) => {
    if (res.resultStatus) {
      uni.showToast({
        title: "提交成功"
      })
      uni.switchTab({
        url: '/pages/myInfo/index'
      })
    } else {
      uni.showToast({
        title: res.errorMessage,
        icon: 'none'
      })
    }
  }).catch((err: any) => {
    uni.showToast({
      title: "服务器异常",
      icon: 'none'
    })
  })
} 
const instance = getCurrentInstance();
const appStorage = instance?.appContext.config.globalProperties.appStorage;
const globalFont = ref()
onLoad((options) => {
  const userInfo_key = appStorage.getObj("userInfo_key");
	globalFont.value = userInfo_key.smallFont
});
</script>
<style lang="scss" scoped>
:root {
  /* 默认字号 */
  --font-size-small: 26rpx;
  /* 中号字号 */
  --font-size-medium: 32rpx;
    /* 大号字号 */
  --font-size-large: 40rpx;
}

.small_font {
  font-size: var(--font-size-small);
}

.small-medium {
  font-size: var(--font-size-medium);
}

.small-large {
  font-size: var(--font-size-large);
}
.content_page {
  padding: 32rpx 32rpx 0;
  background-color: #fff;
  height: calc(100vh - 120rpx);

  &_title {
    // font-size: 28rpx;
    font-weight: bold;
    text-align: left;
    color: #333333;
    letter-spacing: 2rpx;
    line-height: 40rpx;
  }

  &_btn {
    width: 626rpx;
    height: 88rpx;
    background: linear-gradient(90deg, #00a67e, #006d56);
    border-radius: 16rpx;
    line-height: 88rpx;
    text-align: center;
    color: #fff;
    margin: 1000rpx auto 0;
  }
}
</style>
